package com.shop.domain.admin;

import java.util.Date;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.*;
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * <p>AdminActionLog 实体类</p>
 * <p>Table: t_admin_action_log - 管理员操作日志表</p>
 * @author generator
 * @date 2021-02-02 10:09:10
 */
@ApiModel("AdminActionLog 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_admin_action_log")
@SQLDelete(sql = "update t_admin_action_log set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class AdminActionLog extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @JSONField(serialize=false)
    private Long id;

    /**
     * 管理员主键
     */
    @ApiModelProperty("管理员主键")
    @Column(name = "admin_id")
    private Long adminId;

    /**
     * 管理员真实姓名
     */
    @ApiModelProperty("管理员真实姓名")
    @Column(name = "admin_reality_name")
    private String adminRealityName;

    /**
     * 请求ip
     */
    @ApiModelProperty("请求ip")
    @Column(name = "ip")
    private String ip;

    /**
     * 日志名称
     */
    @ApiModelProperty("日志名称")
    @Column(name = "name")
    private String name;

    /**
     * 产生日志的方法名称
     */
    @ApiModelProperty("产生日志的方法名称")
    @Column(name = "method")
    private String method;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 最后一次更新时间
     */
    @ApiModelProperty("最后一次更新时间")
    @Column(name = "update_time")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
     * 是否删除 0：不删除   1：删除
     */
    @ApiModelProperty("是否删除 0：不删除   1：删除")
    @Column(name = "is_deleted")
    @JSONField(serialize=false)
    private Integer isDeleted;
}